In the past, it has been disclosed that, in image encoding, after primary transform is performed for a prediction residual that is a difference between an image and a prediction image of the image, in order to increase the energy compaction (to concentrate transform coefficients to a low frequency region), secondary transform is further applied for each sub block in a transform block (for example, refer to NPL 1). In NPL 1, also it is disclosed that a secondary transform identifier indicative of which secondary transform is to be applied is signaled in a unit of a CU.
Further, it is disclosed that, in an encoder, to determine which secondary transform is to be applied in a unit of a CU as disclosed in NPL 1 on the basis of RDO (Rate-Distortion Optimization) indicates a high degree of calculation complicatedness and a secondary transform flag indicative of whether or not secondary transform in a unit of a transform block is to be applied is signaled (for example, refer to NPL 2). In NPL 2, also it is disclosed that a secondary transform identifier indicative of which secondary transform is to be applied is derived on the basis of a primary transform identifier and an intra-prediction mode.